<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
  <div class="w790">
  <script>
  	function uploaded(path){
		$("#img_url").attr("src",'__PUBLIC__'+path);
		$("input[name='img_url']").val(path); 
	}
	
	function del_img(){
		if(confirm('您确定要删除图片吗?')){
			var file=$("input[name='img_url']").val();
			$.post("{:U('delImgBypath')}",{'path':file},function(data){
				$("input[name='img_url']").val('');
				$("#img_url").attr('src','');
			});
		}else{
			return false;
		}
	}
	//删除图组图片
	function mdel_img(path){
		$('#img_list div img').each(function(index, element) {
			$.post("{:U('delImgBypath')}",{'path':path},function(data){
				if(data=='OK'){
					
					$('#img_list div').each(function(index, element) {
                        if($(this).attr('url')==path){
							$(this).remove();
						}
                    });
					
					$('#picmsg input').each(function(index, element) {
                        if($(this).val()==path){
							$(this).remove();
						}
                    });
				}
			});
		});
	}
  </script>
  <h1><a href="{:U('index')}">返回列表</a></h1>
    <form class="checkoutform" action="{:U('update')}" method="post">
      <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="right">标题</td>
        <td><label for="title"></label>
          <input name="title" type="text" id="title" value="{$info.title}" size="70" />
          <input name="id" type="hidden" id="id" value="{$info.id}" /></td>
      </tr>
      <tr>
        <td align="right">类型</td> 
        <td><select name="type" id="type">
          <option <eq name="info['type']" value="0">selected="selected"</eq> value="0">焦点图</option>
          <option <eq name="info['type']" value="1">selected="selected"</eq> value="1">友情链接</option>
          </select></td>
      </tr>
      <tr>
        <td align="right">图片</td>
        <td><input type="hidden" name="img_url" value="{$info.img_url}" /><iframe width="400" height="40" scrolling="no" frameborder="0" src="{:U('upload')}"></iframe><img onclick="showImgBox(this);" src="<notempty name="info['img_url']">{:getThumbPath($info['img_url'])}<else/>__PUBLIC__/Admin/images/defaultimg.png</notempty>" id="img_url" height="40" /><!--<a href="javascript:void(0);" onclick="del_img();">删除图片</a>--></td>
      </tr>
      <tr>
        <td align="right">外部链接</td>
        <td><input name="link" type="text" value="{$info.link}" id="link" size="70" /></td>
      </tr>
      <tr>
        <td align="right">备注</td>
        <td> <html:editor id="editor" name="remark" type="KindEditor" style="height:400px; width:100%;">{$info.remark}</html:editor></td>
      </tr>
      <tr>
        <td align="right">排序</td>
        <td><input name="sort" type="text" id="sort" value="{$info.sort}" size="4" /></td>
      </tr>
      <tr>
        <td align="right">显示</td>
        <td><label>
          <input name="status" <eq name="vo['status']" value="1">checked="checked"</eq> type="radio" id="is_nav_" value="1" checked="checked" />
          是</label>
          <label>
            <input name="status" <eq name="vo['status']" value="0">checked="checked"</eq> type="radio" id="" value="0" />
          否</label></td>
      </tr>
        <tr><td colspan="2" align="center"><button>提交</button></td>
        </tr>
      </table>
    </form>
  </div>
  <div class="clear"></div>
</div>
</body></html>